I want to save some var to my session, and when i make the request with ajax this dont work. This is the ajax
$http.post('saveToSession', {
      hunts: hunts
    });


the controller:

class HuntController extends \BaseController {

    public function saveItems() {
        Session::put('hunts', Input::get('hunts'));
        return Response::json(array('saved' => true), 200);
    }

    public function destroy($id) {
        Session::forget('hunts');
    }

     public function getHunts() {
        return Session::get('hunts') // dont exits
    }

}

0 תשובות